#ifndef __BUOLA_GUI_X11_CX11EXPOSEHELPER_H__
#define __BUOLA_GUI_X11_CX11EXPOSEHELPER_H__

#include <buola/gui/x11/auto.h>
#include <buola/gui/cexposehelper.h>

namespace buola { namespace gui { namespace x11 {

class CX11ExposeHelper : public CExposeHelper
{
public:
    CX11ExposeHelper(CX11Window *pWindow,img::EGCCaps pGCCaps);
    virtual ~CX11ExposeHelper();

    virtual void DiscardBuffer();
    virtual void InvalidateBuffer();
    virtual void ValidateBuffer();
    virtual bool HasValidBuffer();
    virtual img::CGC *GetGC(const CRegion &pRegion,bool pClear);
    virtual img::CGC *GetGC(bool pClear);
    virtual void ReleaseGC(img::CGC *pGC);
    img::CSurface *GetTripleBuffer(const CRect_d &pRect);
    virtual void CommitBuffer(const CRegion &pRegion);
    virtual void CommitToTripleBuffer(img::CSurface *pTB,const CRect_d &pRect);
    virtual void Scroll(const CPoint_d &pPoint,const CSize_d &pSize,
                            const CPoint_d &pSrcOrigin);

    std::unique_ptr<CDoubleBuffer> mDoubleBuffer;
    std::unique_ptr<CDoubleBuffer> mTripleBuffer;
    CX11Window *mWindow;
    bool mDoubleBufferValid;
    img::EGCCaps mGCCaps;
};

/*namespace x11*/ } /*namespace gui*/ } /*namespace buola*/ }

#endif
